using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
	public static class BO_cms_usp_error_log {
		public static DataTable SelectAll(int status) {
			try {
				usp_cms_usp_error_log_select_all entity = new usp_cms_usp_error_log_select_all();
				entity.STATUS = status;
				return BO_Actions<usp_cms_usp_error_log_select_all>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status) {
			try {
				usp_cms_usp_error_log_select_top entity = new usp_cms_usp_error_log_select_top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return BO_Actions<usp_cms_usp_error_log_select_top>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable Search(int error_id) {
			try {
				usp_cms_usp_error_log_search entity = new usp_cms_usp_error_log_search();
				entity.ERROR_ID = error_id;

				return BO_Actions<usp_cms_usp_error_log_search>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
			try {
				usp_cms_usp_error_log_select_paged entity = new usp_cms_usp_error_log_select_paged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return BO_Actions<usp_cms_usp_error_log_select_paged>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Insert( int error_line, string error_message, int error_number, string error_procedure, int error_severity, int error_state, DateTime error_date, bool is_read, bool status) {
			try {
				usp_cms_usp_error_log_insert entity = new usp_cms_usp_error_log_insert();
                entity.ERROR_LINE = error_line;
                entity.ERROR_MESSAGE = error_message;
                entity.ERROR_NUMBER = error_number;
                entity.ERROR_PROCEDURE = error_procedure;
                entity.ERROR_SEVERITY = error_severity;
                entity.ERROR_STATE = error_state;
                entity.ERROR_DATE = error_date;
                entity.IS_READ = is_read;
                entity.STATUS = status;

				return BO_Actions<usp_cms_usp_error_log_insert>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Update( Int64 error_id, int error_line, string error_message, int error_number, string error_procedure, int error_severity, int error_state, DateTime error_date, bool is_read, bool status) {
			try {
				usp_cms_usp_error_log_update entity = new usp_cms_usp_error_log_update();
                entity.ERROR_ID = error_id;
                entity.ERROR_LINE = error_line;
                entity.ERROR_MESSAGE = error_message;
                entity.ERROR_NUMBER = error_number;
                entity.ERROR_PROCEDURE = error_procedure;
                entity.ERROR_SEVERITY = error_severity;
                entity.ERROR_STATE = error_state;
                entity.ERROR_DATE = error_date;
                entity.IS_READ = is_read;
                entity.STATUS = status;

				return BO_Actions<usp_cms_usp_error_log_update>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Delete(string ids, string spliter, int delete_type) {
			try {
				usp_cms_usp_error_log_delete entity = new usp_cms_usp_error_log_delete();
				entity.IDS = ids;
				entity.SPLITER = spliter;
				entity.DELETE_TYPE = delete_type;

				return BO_Actions<usp_cms_usp_error_log_delete>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Restore(int error_id) {
			try {
				usp_cms_usp_error_log_restore entity = new usp_cms_usp_error_log_restore();
				entity.ERROR_ID = error_id;

				return BO_Actions<usp_cms_usp_error_log_restore>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
	}
}

